package easyDAO;

import models.MyConfig;
import models.SqlReturnModel;
import tools.OperateSql;
import tools.ReadProperties;

/**
 * Created by yangxianming on 2021/5/20.
 */
public class TestSql {
    public static void main(String[] args) {
        MyConfig myConfig = new MyConfig();
        ReadProperties readProperties = new ReadProperties("D:\\javaWorkSpace\\testServer2\\web");
        myConfig.setSplitMark();
        myConfig.setPropertiesConfig(readProperties);
        OperateSql operateSql = new OperateSql(readProperties.getProperties());
        myConfig.setOperateSql(operateSql);

        SqlDispatch sqlDispatch = new SqlDispatch(myConfig);
        String where = "WHERE createtime LIKE \"2021%\"";
        String sql = "SELECT `name`, dirname, detail, createtime FROM design "+where+" ORDER BY createtime DESC;";
        System.out.println(sql);
        SqlReturnModel sqlReturnModel = sqlDispatch.selectWord(sql);
    }
}
